//
//  TrainingHeartRateZoneCell.swift
//  DaRings
//
//  Created by 尹琼 on 2022/11/18.
//

import UIKit
import MYModule

open class TrainingDetailHeartRateZoneCell: TrainingDetailBaseCell {
    
    open var heartRateZoneModel : HeartRateZoneModel? {
        
        didSet {
            
            guard let heartRateZoneModel = heartRateZoneModel else {
                return
            }

            zoneView.bind(to: heartRateZoneModel)
        }
    }
    
    public var zoneView = HeartRateZoneView()
    
    open override func makeUI() {
        super.makeUI()
        
        bgView.addSubview(zoneView)
        
        zoneView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
        
        zoneView.bind(to: HeartRateZoneModel())
        
        zoneView.descriptionView.updateData(textColor: UIColor.HeartRate.theme, title: "heart_rate_zone_description_title".language, explain: "heart_rate_zone_description_content".language,
                                                 explainTextColor: UIColor.HeartRate.theme.withAlphaComponent(0.8),
                                                 bgColor: UIColor.HeartRate.theme)
        
    }

}
